# coding=utf-8
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
driver.get("http://www.baidu.com")

# 设置窗口尺寸
driver.set_window_size(600, 600)

# 寻找hello kitty
driver.find_element_by_id("kw").send_keys("hello kitty")
driver.find_element_by_id("su").click()
time.sleep(3)

# 运用js定位到位置
js = "window.scrollTo(100,450);"
driver.execute_script(js)

time.sleep(3)
driver.quit()